#CMake版本信息
cmake_minimum_required(VERSION 3.4.1)

#加载CPP文件夹下待编译的cpp文件，对于so里方法的调用，也是在这个文件里进行封装，封装好之后给CCodeHelper来调
add_library(native-lib SHARED src/main/cpp/native-lib.cpp )

#动态方式加载
add_library(CNativeFunction SHARED IMPORTED)

#设置so路劲  ${CMAKE_SOURCE_DIR}是CMakeLists.txt的路径   ${ANDROID_ABI} 标识cup类型
set_target_properties(CNativeFunction PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libCNativeFunction.so)

#导入.h头文件的路劲，这样在native-lib.cpp里就可以#include <CNativeFunction.h>，然后就可以使用CNativeFunction里面的方法啦
include_directories(${CMAKE_SOURCE_DIR}/src/main/jniLibs/include)

#导入.h头文件的路劲的另一种写法
#target_include_directories(native-lib PRIVATE ${CMAKE_SOURCE_DIR}/src/main/jniLibs/include)

#设置要链接的库文件的名称
target_link_libraries(native-lib CNativeFunction android  ${log-lib})

#支持-std=gnu++11（不懂干嘛的）
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")

#默认配置项，不用修改
find_library( # Sets the name of the path variable.
              log-lib
              # Specifies the name of the NDK library that
              # you want CMake to locate.
              log )


